package initialize

import (
	"github.com/gin-gonic/gin"
	"web_end/middleware"
	"web_end/router"
)

// Routers /* 初始化路由
func Routers() *gin.Engine {
	gin.SetMode(gin.ReleaseMode)
	Router := gin.Default()
	// 配置跨域
	Router.Use(middleware.Cors())

	ApiGroup := Router.Group("v1")
	router.InitUserRouter(ApiGroup)
	router.InitBaseRouter(ApiGroup)
	router.InitGroupRouter(ApiGroup)
	router.InitProjectRouter(ApiGroup)
	router.InitIterationRouter(ApiGroup)
	router.InitTaskRouter(ApiGroup)

	return Router
}
